const arr = [1,3,5,5,7,87];

const map= (array,fn)=>{
  const result = [];
  for (let index = 0; index < array.length; index++) {
    result.push(fn(array[index]))
  }
  return result;
}

// const newMap = map(arr,(item)=>{
//   return item * item;
// })
// console.log(newMap)

const every = (array,fn)=>{
  let isin = true;
  for (let index = 0; index < array.length; index++) {
    if(!fn(array[index])){
      isin = false;
      break;
    }
  }
  return isin;
}
// const res = every(arr,(item)=>{
//   return item > -1
// })
// console.log(res)

const some=(array,fn)=>{
  let isin =false;
  for (let index = 0; index < array.length; index++) {
    if(fn(array[index])){
      isin = true;
      break;
    }
  }
  return isin;
}
const res  =  some(arr,(item)=>{
  return item % 2 === 0
})
console.log(res)